import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


public class Hash_Table {
	
	public static void OneToOne(){
		HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
		
		map.put(1, 2);
		map.put(2, 2);
		
		System.out.println();
		
		Iterator it = map.entrySet().iterator();
		while(it.hasNext()){
			Map.Entry entry = (Map.Entry)it.next();
			Object key = entry.getKey();
			Object value = entry.getValue();
			System.out.println(key.toString()+" ----> "+value.toString());
		}
	}
	
	public static void OnetoMore(){
		Map<String, ArrayList<Integer>> m = new HashMap<String, ArrayList<Integer>>();
		
		ArrayList<Integer> l = new ArrayList<Integer>();
		l.add(2);
		l.add(3);
		m.put("books",  l);
		//System.out.print(l.contains(2));
		System.out.println(m.toString());
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		OnetoMore();
		OneToOne();
	}

}
